package com.java.tutorials.jdk7.fileattribute;

import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.Set;
/**
 * Created by xuzhike on 2016/1/24.
 */
public class PosixFilePermissionsTest {
    public static void main(String[] args) throws Exception {
        FileSystem fileSystem = FileSystems.getDefault();
        Path directory = fileSystem.getPath("e:/yjbWechat.txt");
        Set<PosixFilePermission> perms = PosixFilePermissions
                .fromString("rwxr-x---");
        FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions
                .asFileAttribute(perms);
        Files.createDirectory(directory, attr);
    }
}
